/**
 * Description:
 * Class Name:FinalLocalVariableTest
 * Date:2022/1/29 10:55
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_4_final修饰符;

public class FinalLocalVariableTest {
    public void test(final int a){
        // 不能对final修饰的形参赋值，下面语句非法
        // a = 5;
    }
    public static void main(String[] args) {
        // 定义final局部变量时指定默认值，则str变量无法重新赋值
        final var str = "Hello";
        final double d;
        d = 5.6d;
    }
}
